<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<!-- ereg() -->
<?php

$email_id = "admin@tutorialspoint.com";
$retval = ereg("(\.)(com$)", $email_id);
if( $retval == true )
{
   echo "Found a .com<br>";
}
else
{
   echo "Could not found a .com<br>";
}
$retval = ereg(("(\.)(com$)"), $email_id, $regs);
if( $retval == true )
{
   echo "Found a .com and reg = ". $regs[0];
}
else
{
   echo "Could not found a .com";
}
?>


<?php
//string sql_regcase (string string)
$version = "php 4.0";
print sql_regcase($version);

?>

<?php
//array spliti (string pattern, string string [, int limit])
$ip = "123.456.789.000"; // some IP address
$iparr = spliti ("\.", $ip, 3); 
print "$iparr[0] <br />";
print "$iparr[1] <br />" ;
print "$iparr[2] <br />"  ;
print "$iparr[3] <br />"  ;

?>

<?php
//array split (string pattern, string string [, int limit])
$ip = "123.456.789.000"; // some IP address
$iparr = split ("\.", $ip); 
print "$iparr[0] <br />";
print "$iparr[1] <br />" ;
print "$iparr[2] <br />"  ;
print "$iparr[3] <br />"  ;

?>

<?php
//string eregi_replace (string pattern, string replacement, string originalstring);
$copy_date = "Copyright 2000";
$copy_date = eregi_replace("([a-z]+)", "&Copy;", $copy_date);
print $copy_date;

?>

<?php
//int eregi(string pattern, string string, [array regs]);
$password = "abc";
if (! eregi ("[[:alnum:]]{8,10}", $password))
{
   print "Invalid password! Passwords must be from 8 - 10 chars";
}
else
{
  print "Valid password";
}
?>

<?php
//string ereg_replace (string pattern, string replacement, string originalstring);
$copy_date = "Copyright 1999";
$copy_date = ereg_replace("([0-9]+)", "2000", $copy_date);
print $copy_date;

?>
</body>
</html>
